<template>
  <div>
    <el-select :value="enterpriseID" placeholder="请选择" style="width: 400px;" @change="onChange">
              <!-- <el-option label="区域一" value="shanghai"></el-option> -->
              <el-option v-for="item in getCompany" :key="item.id" :label="item.company" :value="item.id"></el-option>
     </el-select>
  </div>
</template>

<script>
// 导入封装的接口
import { list } from '../../api/hmmm/companys'
export default {
  props: ['enterpriseID'],
  data () {
    return {
      ruleForm: {},
      getCompany: []
    }
  },
  created () {
    this.getCompanysList()
  },
  methods: {
    // 获取企业列表
    async  getCompanysList () {
      const data = await list({
        page: 1,
        pagesize: 100
      })
      this.getCompany = data.data.items
    },
    onChange (id) {
      this.$emit('update:enterpriseID', id)
    }
  }
}
</script>

<style>

</style>
